package net.println.kotlin.chapter9

fun main(args: Array<String>) {
    //协变，Number是Int的父类
    val numberList:List<Number> = listOf(1,2,3)
    //逆变，Int是Any的子类
    val intComparable:Comparable<Int> = object : Comparable<Any> {
        override fun compareTo(other: Any): Int {
            return 0
        }
    }
    //不变
    val numberArrayList:MutableList<Number> = mutableListOf(1,2,3,4)
}